import 'package:taonile/generated/json/base/json_field.dart';
import 'package:taonile/generated/json/receipt_address_entity.g.dart';
import 'dart:convert';

@JsonSerializable()
class ReceiptAddressEntity {
  late int code;
  late String msg;
  late List<ReceiptAddressData> data=[];

  ReceiptAddressEntity();

  factory ReceiptAddressEntity.fromJson(Map<String, dynamic> json) =>
      $ReceiptAddressEntityFromJson(json);

  Map<String, dynamic> toJson() => $ReceiptAddressEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class ReceiptAddressData {
  late String id = '';
  @JSONField(name: "user_id")
  late String userId = "";
  late String username = "";
  late String mobile = "";
  late String province = "";
  late String city = "";
  late String area = "";
  late String detail = "";
  @JSONField(name: "is_default")
  late String isDefault = "0";
  @JSONField(name: "created_at")
  late String createdAt = "";
  @JSONField(name: "updated_at")
  late String updatedAt = "";
  @JSONField(name: "province_name")
  late String provinceName = "";
  @JSONField(name: "city_name")
  late String cityName = "";
  @JSONField(name: "area_name")
  late String areaName = "";

  ReceiptAddressData();

  factory ReceiptAddressData.fromJson(Map<String, dynamic> json) =>
      $ReceiptAddressDataFromJson(json);

  Map<String, dynamic> toJson() => $ReceiptAddressDataToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}
